package net.freebytes.chat;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

public class AiAnswerHandler extends SimpleChannelInboundHandler {

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
        String key = (String) msg;

        if ("0".equals(key)) {
            ctx.channel().writeAndFlush("暂无人工坐席");
        } else {
            String message = "你选的是：" + key;
            ctx.channel().writeAndFlush(message);
        }
    }
}
